<div class="widgets">
    <!-- Post by Post Term -->
    <div class="widget" id="widget_latest_posts">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Latest Posts'); ?></h3>
        <div class="content">
            <div class="posts home" id="latest_posts">
                <?php if(count($postTerms)): ?>
                    <!-- Print post term tabs -->
                    <ul class="tabs post_terms">
                    <?php foreach($postTerms as $i=>$term): ?>
                        <li><a href="javascript:void(0)"><?php e($term['PostTerm']['name']); ?></a></li>
                    <?php endforeach; ?>
                    </ul>
                    <!-- Print post list -->
                    <?php App::import('Sanitize'); ?>
                    <div class="panes posts">
                    <?php foreach($postTerms as $i=>$term): ?>
                        <ul class="post_list">
                        <?php if(!empty($term['Post'])): ?>
                            <?php foreach($term['Post'] as $i=>$post): $class = $post['attachment_count'] > 0 ? ' has_attachment' : '';?>
                                <li class="post_item<?php echo $class; ?>">
                                    <?php e($html->link(
                                        sprintf('%s(%s)',
 $post['title'], $time->format($options['shortDateFormat'], $post['created'])),
                                        array('controller'=>'posts','action'=>'view',$post['id']),
                                        array('title'=>$text->truncate(Sanitize::stripAll(strip_tags($post['content'])), 180))
                                    )); ?>
                                </li>
                            <?php endforeach; ?>
                        <?php else: ?>
                            <p><?php __('No post under this term'); ?></p>
                        <?php endif; ?>
                        </ul>
                    <?php endforeach; ?>
                </div>
                <?php else: ?>
                    <p><?php __('No post term'); ?></p>
                <?php endif; ?>
            </div>
        </div>
    </div>
    <!-- Company list by created -->
    <div class="widget" id="widget_latest_companies">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Latest Companies'); ?></h3>
        <div class="content">
            <div class="companies home" id="latest_companies">
                <?php if(count($companies)): ?>
                    <ul>
                    <?php foreach($companies as $i=>$company): ?>
                        <li>
                            <?php e($html->link(
                                sprintf('%s(%s)', $company['Company']['name'], $time->format($options['shortDateFormat'], $company['Company']['created'])),
                                array('controller'=>'companies','action'=>'view',$company['Company']['id']),
                                array('title'=>$text->truncate(Sanitize::stripAll(strip_tags($company['Company']['introduction'])), 180))
                            )); ?>
                            <?php e($html->link(' ' , $company['Company']['website'],
                                array(
                                    'title'=>__('Click to visit the official website of the company', true),
                                    'class'=>'external')
                            )); ?>
                        </li>
                    <?php endforeach; ?>
                    </ul>
                <?php else: ?>
                    <p><?php __('No company'); ?></p>
                <?php endif; ?>
            </div>
        </div>
    </div>
    <!-- Job list by created -->
    <div class="widget" id="widget_latest_jobs">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Latest Jobs'); ?></h3>
        <div class="content">
            <div class="jobs home" id="latest_jobs">
                <?php if(count($jobs)): ?>
                    <ul>
                    <?php foreach($jobs as $i=>$job): ?>
                        <li>
                            <?php e($html->link(sprintf('%s(%s)',$job['Job']['title'], $time->format($options['shortDateFormat'], $job['Job']['created'])),
                                array('controller'=>'jobs','action'=>'view',$job['Job']['id']),
                                array('title'=>$text->truncate(Sanitize::stripAll(strip_tags($job['Job']['requirement']))))
                            )); ?>
                        </li>
                    <?php endforeach; ?>
                    </ul>
                <?php else: ?>
                    <p><?php __('No job'); ?></p>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>

<div class="widgets">
    <!-- Searcher -->
    <div class="widget" id="widget_seacher">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Search Something'); ?></h3>
        <div class="content">
            <div class="seacher">
                <?php unset($postTerms, $term, $i); ?>
                <?php e($this->element('form_app_search')); ?>
            </div>
        </div>
    </div>
    <!-- Campus navigation -->
    <div class="widget" id="widget_campus">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Campus Navigation'); ?></h3>
        <div class="content">
            <?php e($this->element('widget_campus')); ?>
        </div>
    </div>
    <!-- Tag Cloud -->
    <div class="widget" id="widget_tagcloud">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Tag Cloud'); ?></h3>
        <div class="content">
            <?php e($tagging->generateCloud($tagcloud, array(
                'url' => array('plugin'=>null, 'controller'=>'tags', 'action'=>'view')
            ))); ?>
        </div>
    </div>
    <!-- Widget weather -->
    <div class="widget" id="widget_weather">
        <div class="toggle">&nbsp;</div>
        <h3 class="handle"><?php __('Yahoo Weather'); ?></h3>
        <div class="content">
            <?php e($this->element('widget_weather', $weather)); ?>
        </div>
    </div>
</div>
<!-- bind Job title toggler for job content -->
<script type="text/javascript">
jQuery(function(){
    $('ul.tabs').tabs('div.panes ul');
    $('#widget_latest_posts').css('min-height', '250px');
    $('#SearchSearch').css('width', '75%');
});
</script>
